<?php

namespace app\api\controller;

use app\api\service\IndexService;
use think\facade\Cache;
use think\facade\Db;
use think\facade\Request;
use app\common\Error;
use app\common\Common;

class Index extends Base
{
    private $service;

    public function __construct(IndexService $service)
    {
        $this->service = $service;
    }

    /**
     * 获取首页数据
     *
     * @param array params
     * @param int page limit
     * @return json
     */
    public function index()
    {
        $params = Request::param();

        $data = Db::name('applet')->where('app_id', $params['app_id'])->value('share_switch');
        if ($data==0) {
            return Common::success(true);
        } else {
            return Common::success(false);
        }


    }


    /**
     * 获取首页数据
     *
     * @param array params
     * @param int page limit
     * @return json
     */
    public function index2()
    {
        $params = Request::param();

        $data = Db::name('applet')->where('app_id', $params['app_id'])->value('share_switch');
        if ($data==0) {
            return Common::success(true);
        } else {
            return Common::success(false);
        }


    }

}